import request from 'src/utils/request' // 添加拦截器

// 增加一条公司信息的信息
export function addcompanys(data) {
    return request({
        url: '/organizer/companys/',
        method: 'post',
        data
    })
}

// 修改一条公司信息的信息
export function redactcompanys(id, data) {
    return request({
        url: `/organizer/companys/${id}/`,
        method: 'patch',
        data
    })
}

// 删除一条公司信息的信息
export function deletecompanys(id) {
    return request({
        url: `/organizer/companys/${id}/`,
        method: 'delete'
    })
}

// 查询停机公司信息的信息
export function getcompanysTableList(query) {
    return request({
        url: '/organizer/companys/list/',
        method: 'get',
        params: query
    })
}

// 增加一条工厂信息的信息
export function addplants(data) {
    return request({
        url: '/organizer/plants/',
        method: 'post',
        data
    })
}

// 修改一条工厂信息的信息
export function redactplants(id, data) {
    return request({
        url: `/organizer/plants/${id}/`,
        method: 'patch',
        data
    })
}

// 删除一条工厂信息的信息
export function deleteplants(id) {
    return request({
        url: `/organizer/plants/${id}/`,
        method: 'delete'
    })
}

// 查询工厂信息的信息
export function getplantsTableList(query) {
    return request({
        url: '/organizer/plants/list/',
        method: 'get',
        params: query
    })
}

// 增加一条车间信息的信息
export function addworkshops(data) {
    return request({
        url: '/organizer/workshops/',
        method: 'post',
        data
    })
}

// 修改一条车间信息的信息
export function redactworkshops(id, data) {
    return request({
        url: `/organizer/workshops/${id}/`,
        method: 'patch',
        data
    })
}

// 删除一条车间信息的信息
export function deleteworkshops(id) {
    return request({
        url: `/organizer/workshops/${id}/`,
        method: 'delete'
    })
}

// 查询车间信息的信息
export function getworkshopsTableList(query) {
    return request({
        url: '/organizer/workshops/',
        method: 'get',
        params: query
    })
}